<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-06-01 11:03:09
 * @LastEditors: voanit
 * @LastEditTime: 2022-06-01 11:18:00
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>1px 问题</title>
  <style>
    body {
      margin: 0;
      padding: 19px
    }

    div {
      padding: 1em;
      margin: 1em;
    }

    .box1 {
      border-top: 1px solid #000;
    }

    .box2 {
      position: relative;
      border-bottom: 1px solid #000;
    }

    .box2::after {
      content: '';
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      height: 1px;
      background-color: #000;
      transform: scaleY(0.5);
    }
  </style>
</head>

<body>
  <div class="box1">
    1px的上边框
  </div>

  <div class="box2">
    1px的下边框
  </div>
</body>

</html>